<template>
  <div>
    <V-CommonHeaderLeft>
      <div id="app">
        <el-row>
          <!-- 头部 -->
          <div class="header">
            <el-col :span="4" class="header-nav">
              <router-link to="/">首页&nbsp;&nbsp;/</router-link>
              <router-link to="/">应用&nbsp;&nbsp;/</router-link>
              <router-link to="/">开放订货平台</router-link>
            </el-col>
            <el-col :span="1" :offset="18">
              <img src alt class="shuImg">
            </el-col>
          </div>
        </el-row>
        <div class="contents">
          <h3>|基础设置</h3>
          <div>
            <div class="contents-redio">
              <el-radio v-model="radio" label="1" @click.native='xianGoods()'>注册后即可立即订货</el-radio>
              <el-radio v-model="radio" label="2" @click.native='hiddenGoods()' class="radio">注册后账号需要审核通过后才可订货</el-radio>
            </div>
            <div class="contents-select">
              <div>
                <span class="contents-select-span1">客户类型</span>
                <el-select v-model="value" placeholder="普通代理商" class="select" style="width:340px;">
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
                <span class="contents-select-span2">设置注册用户的客户类型</span>
              </div>
              <div style="margin-top:10px;">
                <span class="contents-select-span1">归属地域</span>
                <el-cascader
                  v-model="valueS"
                  :options="optionsS"
                  style="width:340px"
                  placeholder="请选择归属区域"
                  class="elCa"
                ></el-cascader>
                <span class="contents-select-span2">设置注册用户的归属区域</span>
              </div>
            </div>
            <div class="wx" v-show="showWx">
              <el-checkbox v-model="checked">允许微信号快速注册</el-checkbox>
              <span style="margin-left:-30px">
                请先设置好微信公众号信息
                <router-link to="/">去设置</router-link>
              </span>
              <span style="display:block;margin-top:10px">启用后客户可使用微信号快速注册客户账号（注：注册页面的其他信息不需要客户填写）</span>
            </div>
          </div>
          <div class="perCus">
            <div class="perCus-header">
              <h3>|员工专属客户邀请二维码</h3>
              <span @click="perToCus()">员工如何邀请客户</span>
            </div>
            <el-row class="perRow">
              <el-col :span="1">序号</el-col>
              <el-col :span="9">姓名</el-col>
              <el-col :span="6">序号</el-col>
              <el-col :span="6">序号</el-col>
              <el-col :span="2">操作</el-col>
            </el-row>
            <el-row class="perRow2">
              <el-col @click.native="addPer()">+添加员工</el-col>
            </el-row>
            <div class="tanPer" v-show="showPer">
              <div class="tanPer-header">
                <h3>请选择员工</h3>
                <p @click="hiddenPer()">X</p>
              </div>
              <input type="search" name id class="search" placeholder="请输入员工名称">
              <el-select v-model="valueP" placeholder="账号状态" class="per-select">
                <el-option
                  v-for="item in optionsP"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
              <el-table
                ref="multipleTable"
                :data="tableData"
                tooltip-effect="dark"
                style="width: 100%"
                @selection-change="handleSelectionChange"
                class="tableData"
              >
                <el-table-column type="selection" width="55"></el-table-column>
                <el-table-column prop="name" label="名称"></el-table-column>
                <el-table-column prop="site" label="项目"></el-table-column>
                <el-table-column prop="state" label="账号状态"></el-table-column>
              </el-table>
            </div>
            <div class="tanPerSelect" v-show="showCus">
              <div class="tanPerSelect-header">
                <h3>员工如何邀请客户</h3>
                <p @click="hiddenCus()">X</p>
              </div>
              <div class="tabPerSelect-center">
                <div class="tanPerSelect-left">
                  <img src="./../../../static/images/img-inviting-customers-1.png" alt>
                  <p class="pBu">步骤一</p>
                  <p class="pApp">进入APP首页，点击“邀请客户”</p>
                </div>
                <div class="tanPerSelect-right">
                  <img src="./../../../static/images/img-inviting-customers-2.png" alt>
                  <p class="pBu">步骤二</p>
                  <p class="pApp">客户扫码注册即可归属为员工的客户</p>
                </div>
              </div>
              <button @click="hiddenCus()">确定</button>
            </div>
          </div>
          <div class="regis">
            <div class="regis-header">
              <h3>|注册页面设置</h3>
              <span @click="blockReg()">推广客户注册页面</span>
            </div>
            <div class="regisTan" v-show="showReg">
              <div class="regisTan-header">
                <h3>推广注册链接</h3>
                <p @click="hiddenReg()">X</p>
              </div>
              <div class="regisTan-center">
                <div class="centerLeft">
                  <p>
                    1、商城注册链接：在企业官网、微信公众号放置商城链接
                    <router-link to="/">如何将链接添加到公众号</router-link>
                  </p>
                  <p>
                    <span class="regisSpan1">注册链接</span>
                    <input type="text" v-model="textCopy" disabled>
                    <span
                      class="copy-btn"
                      v-clipboard:copy="textCopy"
                      v-clipboard:success="onCopy"
                      v-clipboard:error="onError"
                    >复制链接</span>
                    <span class="regisTip">Tips：PC端与手机端的注册链接是一样的</span>
                  </p>
                  <p>2、分享二维码：用手机扫一扫，将手机商城注册页面分享到微信、QQ</p>
                  <p>3、制作宣传物料：将二维码放在宣传海报</p>
                </div>
                <div class="centerRight">
                  <img :src="url" class="img-circle" width="35px" style>
                  <a :href="url" download class="down">下载高清二维码</a>
                </div>
              </div>
            </div>
            <div class="table">
              <table class="tableData">
                <tr>
                  <td>填写项</td>
                  <td>是否启用</td>
                  <td>是否必填项</td>
                  <td style="border:1px solid #e3e3e3">说明</td>
                </tr>
                <tr>
                  <td>手机号码</td>
                  <td>
                    <el-checkbox v-model="checkedTel">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedTelMust">必填项</el-checkbox>
                  </td>
                  <td></td>
                </tr>
                <tr>
                  <td>短信验证码</td>
                  <td>
                    <el-checkbox v-model="checkedInfo">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedInfoMust">必填项</el-checkbox>
                  </td>
                  <td></td>
                </tr>
                <tr>
                  <td>设置登录密码</td>
                  <td>
                    <el-checkbox v-model="checkedLogin">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedLoginMust">必填项</el-checkbox>
                  </td>
                  <td></td>
                </tr>
                <tr>
                  <td>公司名称</td>
                  <td>
                    <el-checkbox v-model="checkedGong">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedGongMust">必填项</el-checkbox>
                  </td>
                  <td></td>
                </tr>
                <tr>
                  <td>联系人名称</td>
                  <td>
                    <el-checkbox v-model="checkedTel">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedTelMust">必填项</el-checkbox>
                  </td>
                  <td style="text-align:left;padding-left:30px;">1、勾选“启用”即客户注册时可填写此项;</td>
                </tr>
                <tr>
                  <td>职位</td>
                  <td>
                    <el-checkbox v-model="checkedZhi">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedZhiMust">必填项</el-checkbox>
                  </td>
                  <td style="text-align:left;padding-left:30px;">2、勾选“必填项”即客户注册时候，必须填写此项</td>
                </tr>
                <tr>
                  <td>所在地区</td>
                  <td>
                    <el-checkbox v-model="checkedAdr">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedAdrMust">必填项</el-checkbox>
                  </td>
                  <td
                    style="text-align:left;padding-left:30px;line-height:20px"
                  >3、客户填写的信息会自动录入系统客户管理的客户资料中，方便您收集客户的基本信息</td>
                </tr>
                <tr>
                  <td>详细地址</td>
                  <td>
                    <el-checkbox v-model="checkedTel">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedTelMust">必填项</el-checkbox>
                  </td>
                  <td></td>
                </tr>
                <tr>
                  <td>加盟原因</td>
                  <td>
                    <el-checkbox v-model="checkedMeng">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedMengMust">必填项</el-checkbox>
                  </td>
                  <td></td>
                </tr>
                <tr>
                  <td>营业执照</td>
                  <td>
                    <el-checkbox v-model="checkedYing">启用</el-checkbox>
                  </td>
                  <td>
                    <el-checkbox v-model="checkedYingMust">必填项</el-checkbox>
                  </td>
                  <td style="border-bottom:1px solid #e3e3e3"></td>
                </tr>
              </table>
              <div style='display:flex'>
                <input
                  type="checkbox"
                  v-model="checkedShangInfo"
                  id="checkInfo"
                  @click="toggleText()"
                  style="margin:20px 0px 0px 0px;width:15px;height:15px;"
                >
                <label for="checkInfo" style="font-size:12px;margin:20px 0px 0px 10px;">启用招商加盟说明</label>
              </div>
              <el-input
                v-if="showText"
                type="textarea"
                placeholder="请写一些说明吧"
                v-model="textarea"
                maxlength="500"
                show-word-limit
                resize="none"
                rows="3"
                class="textArea"
              ></el-input>
            </div>
          </div>
        </div>
        <div class="footer">
          <button>保存</button>
        </div>
      </div>
    </V-CommonHeaderLeft>
  </div>
</template>

<script>
import VCommonHeaderLeft from './../common/vCommonHeaderLeft/VCommonHeaderLeft'
export default {
  components: {
    VCommonHeaderLeft
  },
  data () {
    return {
      radio: '1',
      // 客户类型
      options: [{
        value: '选项1',
        label: '黄金糕'
      }],
      value: '',
      valueS: [],
      optionsS: [
        {
          value: 'zhinan',
          label: '指南',
          children: [{
            value: 'shejiyuanze',
            label: '设计原则',
            children: [{
              value: 'yizhi',
              label: '一致'
            }, {
              value: 'fankui',
              label: '反馈'
            }, {
              value: 'xiaolv',
              label: '效率'
            }, {
              value: 'kekong',
              label: '可控'
            }]
          }, {
            value: 'daohang',
            label: '导航',
            children: [{
              value: 'cexiangdaohang',
              label: '侧向导航'
            }, {
              value: 'dingbudaohang',
              label: '顶部导航'
            }]
          }]
        }, {
          value: 'zujian',
          label: '组件',
          children: [{
            value: 'basic',
            label: 'Basic',
            children: [{
              value: 'layout',
              label: 'Layout 布局'
            }, {
              value: 'color',
              label: 'Color 色彩'
            }, {
              value: 'typography',
              label: 'Typography 字体'
            }, {
              value: 'icon',
              label: 'Icon 图标'
            }, {
              value: 'button',
              label: 'Button 按钮'
            }]
          }, {
            value: 'form',
            label: 'Form',
            children: [{
              value: 'radio',
              label: 'Radio 单选框'
            }]
          }, {
            value: 'data',
            label: 'Data',
            children: [{
              value: 'table',
              label: 'Table 表格'
            }]
          }, {
            value: 'notice',
            label: 'Notice',
            children: [{
              value: 'alert',
              label: 'Alert 警告'
            }]
          }, {
            value: 'navigation',
            label: 'Navigation',
            children: [{
              value: 'menu',
              label: 'NavMenu 导航菜单'
            }]
          }, {
            value: 'others',
            label: 'Others',
            children: [{
              value: 'dialog',
              label: 'Dialog 对话框'
            }]
          }]
        }, {
          value: 'ziyuan',
          label: '资源',
          children: [{
            value: 'axure',
            label: 'Axure Components'
          }, {
            value: 'sketch',
            label: 'Sketch Templates'
          }, {
            value: 'jiaohu',
            label: '组件交互文档'
          }]
        }
      ],
      checked: true,
      // 微信
      showWx: true,
      // 添加员工
      showPer: false,
      optionsP: [{
        value: '选项1',
        label: '黄金糕'
      }],
      valueP: '',
      // 表单
      tableData: [{
        name: '湖南门店下单元',
        site: '下单部',
        state: '启用'
      }],
      multipleSelection: [],
      // 员工邀请客户
      showCus: false,
      showReg: false,
      textCopy: 'https://account.ysdinghuo.com/register?u=256',
      // 二维码地址:
      url: require('./../../../static/images/regisMa.png'),
      // tel
      checkedTel: true,
      checkedTelMust: true,
      // info
      checkedInfo: true,
      checkedInfoMust: true,
      // 登陆
      checkedLogin: true,
      checkedLoginMust: true,
      // 公司
      checkedGong: true,
      checkedGongMust: true,
      // 职位
      checkedZhi: true,
      checkedZhiMust: true,
      // 所在地区：
      checkedAdr: true,
      checkedAdrMust: true,
      // 加盟原因
      checkedMeng: true,
      checkedMengMust: true,
      // 营业执照
      checkedYing: true,
      checkedYingMust: true,
      // 招商加盟说明
      checkedShangInfo: false,
      textarea: '',
      showText: false

    }
  },
  methods: {
    toggleSelection (rows) {
      if (rows) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row)
        })
      } else {
        this.$refs.multipleTable.clearSelection()
      }
    },
    handleSelectionChange (val) {
      this.multipleSelection = val
    },
    // 表单
    addPer () {
      this.showPer = true
    },
    hiddenPer () {
      this.showPer = false
    },
    // 员工邀请客户
    perToCus () {
      this.showCus = true
    },
    hiddenCus () {
      this.showCus = false
    },
    // 复制成功时的回调函数
    onCopy (e) {
      this.$message.success('内容已复制到剪切板！')
    },
    // 复制失败时的回调函数
    onError (e) {
      this.$message.error('抱歉，复制失败！')
    },
    // 推广注册链接
    blockReg () {
      this.showReg = true
    },
    hiddenReg () {
      this.showReg = false
    },
    // 招商说明
    toggleText () {
      this.showText = !this.showText
    },
    // 允许微信号快速注册
    xianGoods () {
      this.showWx = true
    },
    hiddenGoods () {
      this.showWx = false
    }
  }
}
</script>

<style lang="scss" scoped>
#app {
  width: 100%;
  background-color: #f2f5f7;
  height: 100%;
  padding: 15px 10px 0px 10px;
}
.header {
  height: 45px;
  .header-nav {
    line-height: 30px;
    font-size: 12px;
    display: flex;
    justify-content: space-around;
    padding-left: 10px;
    span {
      display: inline-block;
      margin-left: 10px;
    }
    a {
      color: #999999;
    }
    a:hover {
      color: #20ade5;
    }
  }
  .header-img {
    width: 25px;
    height: 25px;
    border-radius: 5px;
    border: 1px solid #dce4e7;
  }
}
.header-nav a:nth-child(3) {
  color: #333;
}
.header-nav a:nth-child(3):hover {
  color: #333;
}
.shuImg {
  width: 20px;
  height: 20px;
  border: 1px solid;
}
.contents {
  padding: 40px 10px 0px 20px;
  background-color: #fff;
  height: 420px;
  overflow-x: hidden;
  overflow-y: scroll;
}
.contents > h3 {
  font-size: 16px;
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3e3e3;
}
.contents-redio {
  display: flex;
  flex-direction: column;
  padding: 20px 0px 0px 15px;
}
.radio {
  margin-top: 15px;
}
.contents-select {
  margin: 20px 0px 0px 0px;
}
.contents-select span {
  font-size: 12px;
}
.contents-select-span1 {
  color: #666666;
  display: inline-block;
  margin-right: 10px;
}
.select /deep/ ::placeholder {
  font-size: 12px;
}
.contents-select-span2 {
  color: #999999;
  margin-left: 10px;
}
.elCa /deep/ ::placeholder {
  font-size: 12px;
}
.wx {
  margin-top: 10px;
}
.wx > span {
  font-size: 12px;
  color: #a69999;
}
.wx a {
  color: #20ade5;
}
.perCus {
  margin-top: 50px;
}
.perCus-header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3e3e3;
}
.perCus-header > h3 {
  font-size: 16px;
}
.perCus-header > span {
  color: #20ade5;
  font-size: 12px;
  display: block;
  margin-top: 5px;
  cursor: pointer;
}
.perRow {
  height: 50px;
  line-height: 50px;
  font-size: 12px;
  background-color: #fcfcfc;
  border: 1px solid #e3e3e3;
  margin-top: 20px;
  color: #666666;
  text-align: center;
}
.perRow2 {
  height: 50px;
  border: 1px solid #e3e3e3;
  border-top: 0;
  font-size: 12px;
  color: #20ade5;
  cursor: pointer;
  text-align: center;
  line-height: 50px;
}
.tanPer {
  width: 1000px;
  height: 450px;
  border: 1px solid;
  position: absolute;
  top: 110px;
  background-color: #fff;
  z-index: 10;
}
.tanPer-header {
  height: 50px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ececec;
  display: flex;
}
.tanPer-header > h3 {
  margin-left: 45%;
  font-size: 16px;
  font-weight: normal;
  line-height: 50px;
}
.tanPer-header > p {
  color: #a0a0a0;
  margin-left: 44%;
  line-height: 50px;
  cursor: pointer;
}
.search {
  width: 270px;
  height: 40px;
  border: 1px solid #f1f1f1;
  border-radius: 5px;
  margin: 15px 15px 15px 10px;
}
.search::placeholder {
  color: #c0c4cc;
  font-size: 12px;
}
.search:hover {
  border-color: #bddfff;
}
.per-select /deep/ ::placeholder {
  font-size: 12px;
}
.tableData /deep/ th {
  height: 50px;
  background-color: #fafafa;
  border-top: 1px solid #e3e3e3;
  font-weight: normal;
  color: #333;
}
.tableData {
  font-size: 12px;
  color: #333;
  height: 270px;
  overflow-x: hidden;
  overflow-y: scroll;
}
.tanPerSelect {
  width: 720px;
  height: 470px;
  border: 1px solid;
  position: absolute;
  top: 120px;
  left: 300px;
  background-color: #fff;
}
.tanPerSelect-header {
  height: 50px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ececec;
  display: flex;
}
.tanPerSelect-header > h3 {
  margin-left: 36%;
  font-size: 16px;
  font-weight: normal;
  line-height: 50px;
}
.tanPerSelect-header > p {
  color: #a0a0a0;
  margin-left: 42%;
  line-height: 50px;
  cursor: pointer;
}
.tabPerSelect-center {
  display: flex;
  justify-content: space-around;
  padding-top: 15px;
}
.pBu {
  padding-left: 60px;
  font-size: 12px;
  line-height: 20px;
  font-weight: bold;
}
.pApp {
  color: #666666;
  font-size: 12px;
  line-height: 20px;
}
.tanPerSelect > button {
  width: 65px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 12px;
  color: #fff;
  background-color: #20ade5;
  border: 0;
  border-radius: 5px;
  float: right;
  margin: 30px 15px 0px 0px;
  cursor: pointer;
}
.regis {
  width: 100%;
  margin-top: 10px;
}
.regis-header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3e3e3;
}
.regis-header > h3 {
  font-size: 16px;
}
.regis-header > span {
  color: #20ade5;
  font-size: 12px;
  display: block;
  margin-top: 5px;
  cursor: pointer;
}
.regisTan {
  width: 720px;
  height: 265px;
  border: 1px solid;
  position: absolute;
  top: 200px;
  left: 250px;
  background-color: #fff;
  z-index: 5;
}
.regisTan-header {
  height: 50px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ececec;
  display: flex;
}
.regisTan-header > h3 {
  margin-left: 40%;
  font-size: 16px;
  font-weight: normal;
  line-height: 50px;
}
.regisTan-header > p {
  color: #a0a0a0;
  margin-left: 42%;
  line-height: 50px;
  cursor: pointer;
}
.regisTan-center {
  padding: 30px 0px 0px 25px;
  display: flex;
}
.centerLeft > p {
  font-size: 12px;
}
.centerLeft > p a {
  color: #20ade5;
}
.centerLeft > p:nth-child(2) {
  margin-top: 15px;
}
.centerLeft > p input {
  width: 300px;
  height: 35px;
  border: 1px solid #e3e3e3;
  border-radius: 5px;
  background-color: #fff;
  text-indent: 1em;
}
.regisSpan1 {
  display: inline-block;
  margin: 0px 10px 0px 20px;
  color: #666666;
}
.copy-btn {
  color: #20ade5;
  cursor: pointer;
  display: inline-block;
  margin-left: 10px;
}
.regisTip {
  color: #999999;
  display: block;
  margin: 10px 0px 10px 80px;
}
.centerLeft > p:nth-child(3) {
  margin: 15px 0px;
}
.img-circle {
  width: 125px;
  height: 125px;
  margin: 0px 0px 10px 70px;
}
.down {
  color: #999999;
  font-size: 12px;
  margin: 0px 0px 0px 90px;
}
.table {
  padding-bottom:100px
}
.tableData {
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 12px;
  width: 100%;
  text-align: center;
}
.tableData > tr:nth-child(1) {
  height: 50px;
  background-color: #f5f5f5;
}
.tableData > tr {
  height: 40px;
}
.tableData > tr td:nth-child(1) {
  width: 240px;
}
.tableData > tr td:nth-child(2) {
  width: 240px;
}
.tableData > tr td:nth-child(3) {
  width: 240px;
}
.tableData td {
  border: 1px solid #e3e3e3;
}
.tableData > tr td:last-child {
  border: 0;
}
.textArea {
  margin-top: 10px;
}
.textArea /deep/ ::placeholder {
  font-size: 12px;
}
.footer {
  width:100%;
  background-color:#fff;
  border-top:1px solid #e3e3e3;
  height:60px;
}
.footer>button {
  width:155px;
  height:45px;
  background-color:#20ade5;
  font-size:12px;
  color:#fff;
  border:0;
  text-align:center;
  line-height:45px;
  float:right;
  margin:10px 15px 0px 0px;
  border-radius: 5px;
  cursor: pointer;
}
</style>
